package com.bestcem.xm.ticket.service.manager.record.param;

import com.bestcem.xm.ticket.controller.param.ticket.InsertTicketParam;
import com.bestcem.xm.ticket.enums.TicketEventEnum;
import com.bestcem.xm.ticket.enums.TicketTemplateFieldNameEnum;
import com.bestcem.xm.ticket.enums.TicketTemplateFieldTypeEnum;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * 工单进度记录 跟进 工具类入参
 *
 * @author XiaoYunSong <ys.xiao@idiaoyan.com>
 * @version v1.0
 * @date 2021/8/18 16:09
 */
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Data
public class FollowedTicketRecordParam extends BaseTicketRecordParam {
    /**
     * isCompleted
     */
    private Boolean isCompleted;
    /**
     * 自定义字段列表
     * 如果字段是 {@link TicketTemplateFieldTypeEnum#TEXT}, 这里就是 String;     例: 'field1' => 'test'
     * 如果是 {@link TicketTemplateFieldTypeEnum#SELECT}, 这里就是int转的String; 例: 'field3' => '1'
     * （2.3）版本去除
     */
    @Deprecated
    private LinkedHashMap<TicketTemplateFieldNameEnum, String> fieldMap;


    /**
     * 处理模板id
     */
    @JsonProperty(value = "template_id")
    private String templateId;

    /**
     * 处理模板答案
     */
    @JsonProperty(value = "template_fields")
    private List<InsertTicketParam.TemplateField> templateFields;


    /**
     * event
     */
    @Override
    public TicketEventEnum getEvent() {
        return TicketEventEnum.COMMIT_FOLLOWED;
    }
}
